import java.util.Scanner;

/**
 * @author vivi
 * @description
 * @date 2024/5/20
 */
public class demo2 {
    public static void main (String[] args) {
        Scanner scanner = new Scanner(System.in);
        int count = scanner.nextInt();


        while (count -- != 0) {
            long n = scanner.nextLong();
            long a = scanner.nextLong();
            long b = scanner.nextLong();
            long ret = 0;

            if (n <= 2) {
                // 人数小于等于2时，任意选择一条价格便宜的船
                ret = Math.min(a, b);
            }else {
                // 人数大于2时，择优选择
                if (a * 3 < b * 2) {
                    // 双人船更便宜，选择双人船
                    ret += n/2 * a;
                    n %= 2;
                    if (n == 1) {
                        // 如果是剩余一人的情况，将单独再租一条双人船的费用和少租一条双人船多租一条三人船的费用做比较
                        ret += Math.min(Math.min(a, b), b - a);
                    }
                }else {
                    //三人船更便宜
                    ret += n/3 *b;
                    n %= 3;
                    if (n == 1) {
                        ret += Math.min(Math.min(a, b), 2 * a - b);
                    }
                    if (n == 2) {
                        ret += Math.min(Math.min(a, b), 3 * a - b);
                    }
                }
            }
            System.out.println(ret);
        }

    }


}
